package com.cy.action;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.util.ArrayList;
import java.util.List;

import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
import org.apache.poi.hssf.usermodel.HSSFClientAnchor;
import org.apache.poi.hssf.usermodel.HSSFCreationHelper;
import org.apache.poi.hssf.usermodel.HSSFRichTextString;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.hssf.util.HSSFColor;
import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.Comment;
import org.apache.poi.ss.usermodel.Drawing;
import org.apache.poi.ss.usermodel.Font;

import com.cy.common.BaseAction;
import com.cy.entity.BackPurview;
import com.cy.entity.BackUserType;
import com.cy.service.BackPurviewService;
import com.cy.service.BackUserService;
import com.cy.session.SessionHelper;

/**
 *	后台窗口控制
 */
public class Menu extends BaseAction{

	private BackPurviewService backPurviewService;
	private BackUserService backUserService;
	private List<BackPurview> purviews;
	public String execute() {
		return null;
	}
	
	public String topMenu(){
		return SUCCESS;
	}
	
	public String leftMenu(){
		if(SessionHelper.getSessionUser().getBackUserType()!=BackUserType.systemAdmin){
			purviews=backUserService.listBackUserAllPurview(SessionHelper.getSessionUser().getId());
		}else{
			purviews=new ArrayList<BackPurview>();
			purviews=backPurviewService.listAllPurviewForSysAdmin();
		}
		return SUCCESS;
	}
	
	public String buttomMenu(){
		return SUCCESS;
	}
	
	public String welecome(){
		return SUCCESS;
	}

	public BackPurviewService getBackPurviewService() {
		return backPurviewService;
	}

	public void setBackPurviewService(BackPurviewService backPurviewService) {
		this.backPurviewService = backPurviewService;
	}

	public BackUserService getBackUserService() {
		return backUserService;
	}

	public void setBackUserService(BackUserService backUserService) {
		this.backUserService = backUserService;
	}

	public List<BackPurview> getPurviews() {
		return purviews;
	}

	public void setPurviews(List<BackPurview> purviews) {
		this.purviews = purviews;
	}
	
	

}
